package Utils;

/**
 * Created by DespairK on 2016/10/8.
 */
public final class TextUtils {
    public TextUtils() {
    }

    public static boolean isEmpty(CharSequence s) {
        return s == null ? true : s.length() == 0;
    }

    public static boolean isBlank(CharSequence s) {
        if (s == null) {
            return true;
        } else {
            for (int i = 0; i < s.length(); ++i) {
                if (!Character.isWhitespace(s.charAt(i))) {
                    return false;
                }
            }

            return true;
        }
    }

    public static boolean isEqual(CharSequence src1, CharSequence src2) {
        return (src1 == null && src2 == null) || (src1 != null && src2 != null && src1.equals(src2));
    }

}
